home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / maxsamosdoors.lha / rs.amos / rs.amosSourceCode
AMOS Source Code  |  1999-01-01  |  1KB  |  81 lines

  1. F= Extension_16_0006(Val(Command Line$))
  2.  
  3. Set Input 10,-1
  4.  
  5. Dim A$(20)
  6. Dim F$(20)
  7.  
  8. Global F$()
  9. Global F
  10.  
  11. Rem *********** read cfg ************* 
  12.  
  13. Open In 1,"doors:rs/rs.cfg"
  14.  
  15. A=1
  16.  
  17. Repeat 
  18.       If Not Eof(1) Then Line Input #1,A$(A)
  19.       If Not Eof(1) Then Line Input #1,F$(A)
  20.       A=A+1
  21. Until Eof(1)
  22. Close 1
  23.  
  24. If F$(A-1)="" Then A=A-1
  25.  
  26. TTAL=A
  27.  
  28. 10 Rem ********** main routine ***********
  29.  
  30. X= Extension_16_002A(Chr$(27)+"[2J"+Chr$(27)+"[0;0H")
  31. If X=20 Then Goto 5000
  32.  
  33. Rem ************ print options *********** 
  34. For A=1 To TTAL
  35.    If A$(A)<>"" Then X= Extension_16_002A(Str$(A)+"  "+A$(A)+Chr$(10))
  36.    If X=20 Then Goto 5000
  37. Next A
  38.  
  39. X= Extension_16_002A(Chr$(10)+" Q - Quit"+Chr$(10)+Chr$(10))
  40. If X=20 Then Goto 5000
  41.  
  42. Rem ************ get input ***************   
  43.  
  44. R$=Space$(69)
  45. Z= Extension_16_0082("Read which file : ",R$)
  46. If Z<>6 Then Goto 5000
  47. N=Instr(R$,Chr$(0))
  48. If N=0 Then N=69
  49. If N>70 Then N=70
  50. R$=Left$(R$,N-1)
  51.  
  52. Rem ************ handle quit options **************
  53.  
  54. If R$="" Then Goto 5000
  55. If R$="q" Then Goto 5000
  56. If R$="Q" Then Goto 5000
  57.  
  58. Rem *********** determine if valid file to display *************** 
  59.  
  60. F=Val(R$)
  61. If F>0 and F<=TTAL Then _SHOW[F]
  62.  
  63. Goto 10
  64.  
  65. BYE:
  66.  
  67. 5000 Rem *************** end **************** 
  68.  Extension_16_0018 
  69. End 
  70.  
  71. Procedure _SHOW[F]
  72.    X= Extension_16_002A(Chr$(27)+"[2J"+Chr$(27)+"[0;0H")
  73.    If X=20 Then BYE
  74.    If Exist(F$(F)) Then A= Extension_16_00D0(F$(F))
  75.    If A=20 Then BYE
  76. End Proc
  77.  
  78. Procedure BYE
  79.  Extension_16_0018 
  80. End 
  81. End Proc